﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using Opennav.MapGenerator.Geometry;

namespace Opennav.MapGenerator.Map.MapTiles
{
    public abstract class MapObject
    {
        public static ushort SHAPE = 0xC000;
        public static ushort POINT = 0x4000;
        public static ushort LINE = 0x8000;
        public static ushort HAS_REF = 0x2000;
        public static ushort LAST_MAPOBJECT_FLAG = 0x1000; 

        private List<MapReference> references = new List<MapReference>();

        protected MapObject(int minResolution, int maxResolution)
        {
            this.MinResolution = minResolution;
            this.MaxResolution = maxResolution;
        }

        public int MinResolution { get; set; }

        public int MaxResolution { get; set; }

        public abstract void Write(Stream stream, MapTile tile, bool last);

        public abstract Coordinate Coordinate { get; }

        public IList<MapReference> References
        {
            get { return references; }
        }
    }
}
